package com.example.societiesSystem.controller;

import com.example.societiesSystem.common.R;
import com.example.societiesSystem.service.EmailService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author：G-L
 * @Version：1.0
 */
@RestController
@Api(tags = "邮箱管理")
@CrossOrigin
public class EmailController {

    @Autowired
    private EmailService emailService;

    /**
     * 发送邮件 get
     * @return
     */
    @ApiOperation(value = "发送邮件")
    @GetMapping("/email/putEmail")
    public R putEmail(@RequestParam("email") String email) {
        emailService.putEmail(email);
        return R.ok();
    }
}
